//Date: 2025-02-10 13:16:33
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define P emplace_back
#define CLEAR(a,v) memset(a,(v),sizeof(a))
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
//char buf[1<<20],*p1,*p2;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline int rd() {
    int s=0,m=0;char ch=getchar();
    while(!isdigit(ch)) {if(ch=='-')m=1;ch=getchar();}
    while( isdigit(ch)) s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
    return m?-s:s;
}
bool MBE;
namespace SOLVER {
const int M=1e9+7;
void MAIN() {
    int n=rd(),k=rd(),ans=1;cout<<"YES\n";
    if(n<k) {rep(i,1,n) ans=ans*2%M;cout<<ans<<endl;}
    else cout<<k<<endl;
}
}
bool MED;
signed main() {
    freopen("life.in","r",stdin);freopen("life.out","w",stdout);
    for(int tt=1;tt;tt--) SOLVER::MAIN();
    cerr<<(&MBE-&MED)/1024<<" KB, "<<1000*clock()/CLOCKS_PER_SEC<<" ms\n";
    return 0;
}